<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <link rel="stylesheet" href="./lib/bootstrap/css/bootstrap.min.css">
  <link rel="stylesheet" href="./lib/nprogress/nprogress.css">
  <link rel="stylesheet" href="./lib/bootstrap-validator/css/bootstrapValidator.min.css">
  <link rel="stylesheet" href="./css/common.css">
  <title>淘乐购-商品管理</title>
</head>

<body>
  <div class="lt-aside bg-body">
    <div class="band">淘乐购37</div>
    <div class="user">
      <img src="./images/default.png" alt="">
      <p>超级管理员</p>
    </div>
    <div class="nav">
      <ul>
        <li><a href="./user.html"><span class="glyphicon glyphicon-user"></span> 用户管理</a></li>
        <li class="nav-cate">
          <a href="javascript:;"><span class="glyphicon glyphicon-list"></span> 分类管理</a>
          <ul class="second">
            <li><a href="./one.html">一级分类</a></li>
            <li><a href="./two.html">二级分类</a></li>
          </ul>
        </li>
        <li class="current"><a href="./product.html"><span class="glyphicon glyphicon-tag"></span> 商品管理</a></li>
      </ul>
    </div>
  </div>
  <div class="lt-main">
    <div class="m-topbar">
      <a href="javascript:;" class="menu pull-left"><span class="glyphicon glyphicon-align-justify"></span></a>
      <a href="#" class="logout pull-right" data-toggle="modal" data-target="#myModal"><span
          class="glyphicon glyphicon-log-out"></span></a>
    </div>
    <div class="m-content">
      <!-- 路径导航 -->
      <ol class="breadcrumb">
        <li><a href="./index.html">管理系统</a></li>
        <li class="active">商品管理</li>
      </ol>

      <!-- 添加分类 -->
      <button type="button" class="btn btn-default" data-toggle="modal" data-target="#addModal">添加分类</button>

      <!-- 二级分类表格 -->
      <table class="table table-bordered text-center cate-info mt-20 table-hover">
        <thead>
          <tr>
            <th>序号</th>
            <th width=25%>商品名称</th>
            <th>商品描述</th>
            <th>商品库存</th>
            <th>商品尺寸</th>
            <th>商品状态</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>1</td>
            <td>【莹恋】MIZUNO美津浓V1GA159002乒乓球鞋男鞋女鞋室内综合训练鞋</td>
            <td>描述123123</td>
            <td>44</td>
            <td>35-56</td>
            <td>已上架</td>
            <td>
              <button class="btn btn-danger">下架</button>
              <button class="btn btn-success">上架</button>
            </td>
          </tr>
        </tbody>
      </table>

      <!-- 分页 -->
      <nav aria-label="Page navigation" class="pull-right">
        <ul class="pagination">
          <li>
            <a href="#" aria-label="Previous">
              <span aria-hidden="true">&laquo;</span>
            </a>
          </li>
          <li class="active"><a href="#">1</a></li>
          <li><a href="#">2</a></li>
          <li><a href="#">3</a></li>
          <li>
            <a href="#" aria-label="Next">
              <span aria-hidden="true">&raquo;</span>
            </a>
          </li>
        </ul>
      </nav>
    </div>
  </div>

  <!-- 退出模态框 -->
  <!-- Modal -->
  <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog modal-sm" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
              aria-hidden="true">&times;</span></button>
          <h4 class="modal-title" id="myModalLabel">温馨提示</h4>
        </div>
        <div class="modal-body">
          <p class="red"><span class="glyphicon glyphicon-info-sign"></span>您确定要退出后台管理系统吗</p>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
          <button type="button" class="btn btn-primary btn-logout">退出</button>
        </div>
      </div>
    </div>
  </div>

  <!-- 商品添加模态框 -->
  <div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
              aria-hidden="true">&times;</span></button>
          <h4 class="modal-title" id="myModalLabel">添加商品</h4>
        </div>
        <div class="modal-body">

          <form id="form">
            <div class="form-group">
              <div class="dropdown">
                <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown"
                  aria-haspopup="true" aria-expanded="true">
                  <span class="d-title">请选择二级分类</span>
                  <span class="caret"></span>
                </button>
                <ul class="dropdown-menu check-cate" aria-labelledby="dropdownMenu1">
                  <li><a href="#">马丁靴</a></li>
                </ul>
                <!-- 隐藏域，上传用户选中的二级分类 -->
                <input type="hidden" name="brandId">
              </div>
            </div>
            <div class="form-group">
              <input type="text" class="form-control" name="proName" placeholder="请输入商品名称" autocomplete="off">
            </div>
            <div class="form-group">
                <textarea class="form-control" rows="3" name="proDesc" placeholder="请输入商品描述"></textarea>
            </div>
            <div class="form-group">
              <input type="text" class="form-control" name="num" placeholder="请输入商品库存" autocomplete="off">
            </div>
            <div class="form-group">
              <input type="text" class="form-control" name="size" placeholder="请输入商品尺码" autocomplete="off">
            </div>
            <div class="form-group">
              <input type="text" class="form-control" name="oldPrice" placeholder="请输入商品原价" autocomplete="off">
            </div>
            <div class="form-group">
              <input type="text" class="form-control" name="price" placeholder="请输入商品现价" autocomplete="off">
            </div>
            <div class="form-group">
              <label for="file" class="btn btn-default">上传图片</label>
              <!-- 隐藏图片上传的文件域 -->
              <input type="file" name="pic1" class="hide" id="file" data-url="/product/addProductPic" multiple>
            </div>
            <div class="form-group">
              <!-- 预览图片 -->
              <div class="img-box"></div>
              <!-- 判断图片上传的数量 -->
              <input type="hidden" name="picStatus" >
              <!-- 隐藏域保存图片地址 -->
              <input type="hidden" name="picArr">
            </div>
          </form>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
          <button type="submit" form="form" class="btn btn-primary btn-add">添加</button>
        </div>
      </div>
    </div>
  </div>

  <!-- 产品渲染模板引擎 -->
  <script type="text/html" id="tmp-pro">
    {{ each rows v i}}
      <tr>
        <td>{{ (page-1)*size+i+1 }}</td>
        <td>{{ v.proName }}</td>
        <td>{{ v.proDesc }}</td>
        <td>{{ v.num }}</td>
        <td>{{ v.size }}</td>
        <td>{{ v.statu==1 ? '已上架' : ' 已下架' }}</td>
        <td>
          {{ if v.statu==1 }}
            <button class="btn btn-danger">下架</button>
          {{ else }}
            <button class="btn btn-success">上架</button>
          {{ /if }}
        </td>
      </tr>
    {{ /each }}
  </script>

  <!-- 二级分类模板引擎 -->
  <script type="text/html" id="tmp-chek">
    {{ each rows v i}}
      <li><a href="#" data-id="{{ v.id }}">{{ v.brandName }}</a></li>
    {{ /each }}
  </script>
</body>

<script src="./lib/jquery/jquery.min.js"></script>
<script src="./lib/bootstrap/js/bootstrap.min.js"></script>
<script src="./lib/nprogress/nprogress.js"></script>
<script src="./lib/artTemplate/template-web.js"></script>
<script src="./lib/bootstrap-paginator/bootstrap-paginator.min.js"></script>
<script src="./lib/jquery-fileupload/jquery.ui.widget.js"></script>
<script src="./lib/jquery-fileupload/jquery.iframe-transport.js"></script>
<script src="./lib/jquery-fileupload/jquery.fileupload.js"></script>
<script src="./lib/bootstrap-validator/js/bootstrapValidator.min.js"></script>
<script src="./js/isLogin.js"></script>
<script src="./js/common.js"></script>
<script src="./js/product.js"></script>

</html>